package com.itheima.publisher;


import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class PublisherApplication {
    public static void main(String[] args) {
        SpringApplication.run(PublisherApplication.class);
    }

    @Bean
    public MessageConverter jacksonMessageConverter(){   //消息转换器 Jackson2JsonMessageConverter 是让 RabbitMQ 发送和接收消息时都用 JSON 格式的“翻译器”，让消息可读、安全、可跨语言。
        return new Jackson2JsonMessageConverter();
    }
}
